﻿using Paas.Core.Const.Enums.Common;
using Paas.Core.Sys.Entities;
using Basefr.Attributes;
using Basefr.Core.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Paas.Core.Common.Entities
{
    /// <summary>
    /// 通知
    /// </summary>
    [MainTable(nameof(Notice))]
    public class Notice : EntityBase
    {
        /// <summary>
        /// 接收人
        /// </summary>
        public long ToId { get; set; }
        [ForeignKey(nameof(ToId))]
        public virtual User To { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string Title { get; set; }

        /// <summary>
        /// 通知类型
        /// </summary>
        public EnumNoticeType Type { get; set; }

        /// <summary>
        /// 对象ID
        /// </summary>
        public int ObjectId { get; set; }

        /// <summary>
        /// 跳转链接
        /// </summary>
        [MaxLength(200)]
        public string Link { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [MaxLength]
        public string Content { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        public bool IsRead { get; set; }
    }
}

